<?php
namespace app;

class ApiException extends \Exception
{

    private $error;

    public function __construct($message, $code = 0) { 
        $this->error['code']    =  $code;
        $this->error['message'] =  $message;
        $this->setExceptionLog($this->error);
        //parent::__construct($message);
    }

    function getException() {
        return $this->error;
    }

    function setExceptionLog() {
        echo toJson($this->error['message'],$this->error['code']);exit;
    }
}